package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;

public class SplashActivity extends AppCompatActivity {
    ImageView mTvSplash;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        initView();
    }

    private void initView() {
        mTvSplash=findViewById(R.id.iv_splash);
//        Animation animation= AnimationUtils.loadAnimation(this,R.anim.splash);
        Animation alphaAnimation=new AlphaAnimation(0.0f,1.0f);
        alphaAnimation.setDuration(3000);
        Animation scaleAnimation=new ScaleAnimation(1,1.2f,1,1.2f);
        scaleAnimation.setDuration(3000);
        AnimationSet animationSet=new AnimationSet(this,null);
        animationSet.addAnimation(alphaAnimation);
        animationSet.addAnimation(scaleAnimation);
        animationSet.setFillAfter(true);
        mTvSplash.setAnimation(animationSet);
    }
}